package com.WGrape.OJ.service;

import com.WGrape.OJ.model.dto.question.QuestionQueryRequest;
import com.WGrape.OJ.model.entity.Question;
import com.WGrape.OJ.model.vo.QuestionVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;

/**
* @author Wait葡萄成熟时
* @description 针对表【question(题目)】的数据库操作Service
* @createDate 2025-05-14 15:06:08
*/
public interface QuestionService extends IService<Question> {
    /**
     * description 校验题目信息
     * author Wait葡萄成熟时
     */
    void validQuestion(Question question, boolean add);
    /**
     * description 构建QueryWrapper查询
     * author Wait葡萄成熟时
     */
    QueryWrapper<Question> getQueryWrapper(QuestionQueryRequest questionQueryRequest);
    /**
     * description 获取单个封装
     * author Wait葡萄成熟时
     */
    QuestionVO getQuestionVO(Question question, HttpServletRequest request);
    /**
     * description 分页获取封装
     * author Wait葡萄成熟时
     */
    Page<QuestionVO> getQuestionVOPage(Page<Question> questionPage, HttpServletRequest request);
}
